var t = getApp();

Page({
    data: {
        order_pay_id: "",
        pid: "",
        uid: ""
    },
    onLoad: function(t) {
        t.order_pay_id && this.setData({
            order_pay_id: t.order_pay_id
        }), t.pid && this.setData({
            pid: t.pid
        });
        try {
            var i = wx.getStorageSync("uid");
            i && this.setData({
                uid: i
            });
        } catch (t) {}
        this.verificationCash();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    verificationCash: function() {
        var i = this, a = "";
        a += t.getNetAddresss("plugin.store-cashier.frontend.store.order-detail.payment-qr-code-url"), 
        console.log(this.data.order_pay_id), console.log(this.data.pid ? this.data.pid : this.data.uid), 
        a += "&order_pay_id=" + this.data.order_pay_id, a += "&pid=" + (this.data.pid ? this.data.pid : this.data.uid), 
        t._getNetWork({
            url: a,
            success: function(t) {
                var a = t.data;
                1 == a.result ? i.setData({
                    qrcode: a.data.miQrCodeUrl,
                    showQrcode: !0
                }) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1500,
                    success: function() {
                        setTimeout(function() {
                            wx.navigateBack({
                                delta: 1
                            });
                        }, 1500);
                    }
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});